import instance from '../../utils/request'

/**
 * 查询申请单
 * @param params 分页、条件新年喜
 * @returns {*}
 */
export function findInApply(params) {
    return instance.get("/crm/refacinapply/find", {params: params})
}

/**
 * 根据id获得申请单信息
 * @param id
 * @returns {*}
 */
export function findInApplyById(id) {
    return instance.get("/crm/refacinapply/getInApplyById", {params: {id: id}});
}

/**
 * 根据出库申请单获得商品，并将出库商品转化为入库商品
 * @param id
 * @returns {*}
 */
export function getInGoodWithOutApplyId(id) {
    return instance.get("/crm/refacoutgoods/getGoods", {params: {odoId: id}})
}

/**
 * 根据入库申请单id获得商品信息
 * @param id
 * @returns {*}
 */
export function getInGoodWithInApplyId(id) {
    return instance.get("/crm/refacingoods/getGoods", {params: {id: id}})
}

/**
 * 添加新订单
 * @param params
 * @returns {*}
 */
export function addNewInApply(params) {
    return instance.post("/crm/refacinapply/addInApply", params);
}

/**
 * 修改出库单
 * @param params
 * @returns {*}
 */
export function alterInApply(params) {
    return instance.post("/crm/refacinapply/alterInApply", params);
}

/**
 *批量删除
 * @param idList
 * @returns {*}
 */
export function batchDelInApply(idList) {
    return instance.delete("/crm/refacinapply/batchDelete", {data: idList});
}

export function approveInApply(params) {
    return instance.post("/crm/refacinapply/approveInApply",params)
}